//
//  CZCommentLoadingCell.swift
//  GZWeibo007
//
//  Created by Raymond on 15/12/25.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit
/// 菊花cell
class CZCommentLoadingCell: UITableViewCell {
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        prepareUI()
        
        loadingView.startAnimating()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func prepareForReuse() {
         loadingView.startAnimating()
    }
    
    func prepareUI() {
        contentView.addSubview(loadingView)
        contentView.addSubview(contentLabel)
        
        loadingView.ff_AlignInner(type: ff_AlignType.CenterLeft, referView: contentView, size: nil, offset: CGPoint(x: 100, y: 0))
        contentLabel.ff_AlignHorizontal(type: ff_AlignType.CenterRight, referView: loadingView, size: nil, offset: CGPoint(x: 16, y: 0))
    }

    // MARK: 懒加载
    /// 菊花
    private lazy var loadingView: UIActivityIndicatorView = {
        let view = UIActivityIndicatorView()
        view.color = UIColor.blueColor()
        return view
    }()
    /// 文字
    private lazy var contentLabel: UILabel = {
        let label = UILabel(color: UIColor.blackColor(), fontSize: 14)
        label.text = "正在加载数据"
        
        return label
    }()
    
}
